<?php 

namespace app\common\shop;

use think\Db;
use think\Model;
use traits\model\SoftDelete;


class WithdrawLogModel extends model {
    //use SoftDelete;//开启了软删除
    //protected  = 'del_time';
    // 完整数据表名
    protected $table = 'withdraw_log';
    public $to = [
        1=>'支付宝',
        2=>'微信'
    ];
    public $status = [
        0=>'待审核',
        1=>'通过',
        2=>'拒绝'
    ];
    /**
     * [建表]
     * @return
     */
    public static function createTable(){
        return Db::query("CREATE TABLE If Not Exists `withdraw_log` (
              `id` int(11) NOT NULL AUTO_INCREMENT,
              `uid` int(11) NOT NULL  DEFAULT '0' COMMENT '会员id',
              `type` int(11) NOT NULL  DEFAULT '0' COMMENT '提现到 1支付宝 2微信',
              `money` decimal(22,2) NOT NULL DEFAULT '0' COMMENT '提现金额',
              `fee` decimal(22,2) NOT NULL DEFAULT '0' COMMENT '手续费',
              `status` int(11) NOT NULL DEFAULT '0' COMMENT '状态',
              `createtime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '时间',
              `finishtime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '审核时间',
              PRIMARY KEY (`id`)
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='提现记录表'");
    }
 	/**
     * [添加]
     * @return
    */
    public static function add($data){
    	$data['createtime'] = time();
    	return self::insertGetId($data);
    }
}